<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        nav{
            margin-top: 30px;
            display: flex;
            justify-content: center;
            position: sticky;
            top: 15px;
            height: 60px;
            display: flex;
            justify-content: center;
            background-color: aqua;
            border-radius: 15px;
            box-shadow: 0 0 5px 10px rgba(221, 3, 3, 0.5);
            
        }
        .main{
            height: 1000px;
            background-color: antiquewhite;
            display: flex;
            justify-content: center;
        }
        

        .box{
            display: flex;
            justify-content: center;
            align-items: center;
            position: fixed;
            left: 50%;
            margin-left: -300px;
            bottom: 30px;
            width: 600px;
            height: 120px;
            background-color: brown;
            border-radius: 15px;
            /* margin: 0 auto; 对定位无效*/
        }
    </style>
</head>
<body>
    <nav>
        <div class="nav"></div>
    </nav>
    <div class="main">
        
    </div>
    <div class="box"><a href="#">返回顶部</a></div>
</body>
</html>